#ifndef ARTICLE_H
#define ARTICLE_H

#include <QString>
#include <QVariantMap>

const QString article_backend = "http://127.0.0.1:2344";

struct Article {
    int article_id;
    QString title;
    QString content;
    QStringList images;

    static struct Article fromVariantMap(QVariantMap map) {
        struct Article article;
        article.article_id = map.value("article_id").toInt();
        article.title = map.value("title").toString();
        article.content = map.value("content").toString();
        article.images = map.value("images").toStringList();
        return article;
    }
};

#endif // ARTICLE_H
